package com.heima.sjms.单例模式.更高级单例;

import com.heima.sjms.单例模式.Student;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Constructor;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * @author 陈辉
 * @data 2023 14:03
 */
enum Season{
    SPRING,
    SUMMER,
    AUTUMN,
    WINTER;
    private Season(){};
}
public class Demo1 {

    public static void main(String[] args) throws Exception {

            try {
                Season spring = Season.SPRING;
                System.out.println("spring = " + spring);

                ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("day02_HashMap_ArrayList\\a.txt"));
                oos.writeObject(spring);


                ObjectInputStream ois = new ObjectInputStream(new FileInputStream("day02_HashMap_ArrayList\\a.txt"));
                Season spring1 = (Season) ois.readObject();
                System.out.println("spring1 = " + spring1);
            } catch (Exception e) {
                e.printStackTrace();
            }

    }


}
